/*
*	Copyright (C) 2014  Julio Montes, Mario Carrillo
*
*	Julio Montes e-mail: imc.coder@gmail.com
*
*	Mario Carrillo e-mail: mario_90ago@live.com.mx
*
*	BSD 3-Clause License
*/

#ifndef FILECREATOR_H
#define FILECREATOR_H

#include <wx/wx.h>
#include <vector>
#include <iostream>
#include <fstream>
#include <math.h>
#include <fstream>
#include <sstream>

#define ID_OK2 11
#define ID_CANCEL2 22

using namespace std;

namespace alliance
{
class FileCreator:public wxDialog
{
public:
    FileCreator(const wxString& title,char fileNameIn[],char fileNameOut[],int typeFile);
    virtual ~FileCreator();
    bool GetErrorFileCreation();

private:
    void ShowInterfaceValuesFileIOC();
    void ShowInterfaceValuesFilePAT();
    void CreatFileIOC(char FileNameOutIOC[]);
    void CreatFilePAT(char FileNameOutPAT[]);
    void AnalyzerFile(char FileNameIn[]);
    void MakeCastingSize(string *v1,string *v2,int *SI);
    void WriteFileIOC(ofstream *WF,int j,int i,int Flag);
    void OnOk(wxCommandEvent& event);
    void OnCancel(wxCommandEvent& event);
    string ConvertionBinary(int num,int limit);

    bool m_errors;
    wxStaticText *m_instruction,*m_instruction2;
    wxComboBox *m_filesChoose;
    wxButton *m_buttonOk;
    wxButton *m_buttonCancel;
    wxTextCtrl *m_fieldNameFileOut;
    int m_TF;
    wxStaticText  *m_labelT;
    wxStaticText  *m_labelTimeStart;
    wxStaticText  *m_labelTimeIncr;
    wxStaticText  *m_labelTimeUnit;
    wxStaticText  *m_labelIncrease;
    wxStaticText  *m_labelName;
    wxStaticText  *m_labelType;
    wxStaticText  *m_labelPosition;
    wxStaticText  *m_labelRepetition;
    wxTextCtrl    *m_startTime;
    wxTextCtrl    *m_increTime;
    wxTextCtrl    *m_unitTime;
    wxTextCtrl    *m_repetition;
    wxScrolledWindow *m_areaValues;
    wxArrayString m_position_Values;
    vector<wxComboBox *> m_vectorCheck;
    vector<wxStaticText *> m_vectorInOut;
    vector<wxTextCtrl *> m_vectorValueSignalPAT;

    char *m_fileOutFC;

    struct IN_OUTS
    {
        string NameInOut;
        string ModeInOut;
        unsigned int    SizeIntInOut;
        unsigned int Acum;
    };

    struct IN_OUTS m_node;
    vector <IN_OUTS> m_v;
    vector <string> m_vectorInOuts;
    size_t  m_equalsSize;
    size_t i;

};
}

#endif // FILECREATOR_H

